<template>
  <div>
    <BasicForm @register="registerForm"> </BasicForm>
  </div>
</template>

<script lang="ts" setup>
  import { BasicForm, useForm, FormSchema } from '/@/components/Form';
  import { watch } from 'vue';
  // 组件通信
  // eslint-disable-next-line vue/require-prop-types
  const props = defineProps(['tabType']);

  //表单组件内容
  const schemas1: FormSchema[] = [
    {
      field: 'ReceivingName',
      required: true,
      component: 'Input',
      label: '收件人名称',
      colProps: {
        span: 24,
      },
      componentProps: {
        placeholder: '请输入收件人名称',
      },
    },
  ];
  const schemas2: FormSchema[] = [
    {
      field: 'describe',
      component: 'Input',
      label: '描述',
      colProps: {
        span: 24,
      },
      componentProps: {
        placeholder: '请输入描述信息',
        style: {
          height: '55px',
        },
      },
    },
  ];
  //表单初始化
  const [registerForm, { setProps }] = useForm({
    schemas: schemas1,
    layout: 'vertical',
    actionColOptions: {
      span: 24,
    },
    showActionButtonGroup: false,
  });
  function setSchemas(schemas) {
    setProps({
      schemas,
    });
  }
</script>
